#include <iostream>
using std::cout;
using std::endl;

//Point二维平面上面的点
class Point{
public:
    Point(int x, int y)
    :_ix(x)
    ,_iy(y)
    {
        //_ix = x;因为C++语法认为这些不能够算是初始化
        //而应该叫做赋值操作
        //_iy = y;
    }
    Point()
    :_ix(0)
    ,_iy(0)
    {
       // _ix = 0;
       // _iy = 0;
    }


    void print(){
        cout << "(" << _ix << "," << _iy << ")" << endl;
    }


private:
    int _ix;
    int _iy;
};


void test(){
    Point pt;//利用无参构造函数来创建一个pt对象
    pt.print();

    Point pt2(1, 2);//利用有参构造函数来创建一个pt对象
    pt2.print();
}

int main()
{
    test();
    return 0;
}

